package vista;

import java.awt.Dimension;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;

import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DialogJugador extends javax.swing.JFrame {
	private JPanel jPanelJugador;
	private JTextField jTxtNombreJug;
	private JButton jBttCancelar;
	private JButton jBttRegJug;
	private JLabel jLblNombreJugador;

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/

	
	public DialogJugador() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setPreferredSize(new java.awt.Dimension(329, 117));
			{
				jPanelJugador = new JPanel();
				this.add(jPanelJugador);
				jPanelJugador.setPreferredSize(new java.awt.Dimension(319, 120));
				jPanelJugador.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
				jPanelJugador.setLayout(null);
				{
					jLblNombreJugador = new JLabel();
					jPanelJugador.add(jLblNombreJugador);
					jLblNombreJugador.setText("Por favor, introduzca su nombre:");
					jLblNombreJugador.setBounds(13, 13, 273, 15);
					jLblNombreJugador.setFont(new java.awt.Font("Dialog",1,14));
				}
				{
					jTxtNombreJug = new JTextField();
					jPanelJugador.add(jTxtNombreJug);
					jTxtNombreJug.setBounds(13, 34, 279, 22);
				}
				{
					jBttRegJug = new JButton();
					jPanelJugador.add(jBttRegJug);
					jBttRegJug.setText("Registrar");
					jBttRegJug.setBounds(25, 62, 121, 27);
					jBttRegJug.setFont(new java.awt.Font("Dialog",1,14));
				}
				{
					jBttCancelar = new JButton();
					jPanelJugador.add(jBttCancelar);
					jBttCancelar.setText("Cancelar");
					jBttCancelar.setBounds(165, 62, 121, 27);
					jBttCancelar.setFont(new java.awt.Font("Dialog",1,14));
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

		
		public void addListener(ActionListener actionListener) {
			jBttRegJug.addActionListener(actionListener);
			jBttCancelar.addActionListener(actionListener);
		}

		public void mostrarMensaje(String mensaje) {
			JOptionPane.showMessageDialog(this, mensaje);
		}
		
		public String getNombre() {
			return jTxtNombreJug.getText();
		}
		
		public void borrarDatos()
		{
			jTxtNombreJug.setText("");
		}

		public JButton getjBttCancelar() {
			return jBttCancelar;
		}

		public void setjBttCancelar(JButton jBttCancelar) {
			this.jBttCancelar = jBttCancelar;
		}

		public JButton getjBttRegJug() {
			return jBttRegJug;
		}

		public void setjBttRegJug(JButton jBttRegJug) {
			this.jBttRegJug = jBttRegJug;
		}

		public JTextField getjTxtNombreJug() {
			return jTxtNombreJug;
		}

		public void setjTxtNombreJug(JTextField jTxtNombreJug) {
			this.jTxtNombreJug = jTxtNombreJug;
		}
		
		
		
	}
